.class Lrexsee/open/TencentOauth$4;
.super Ljava/lang/Thread;
.source "TencentOauth.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lrexsee/open/TencentOauth;->accessToken(Lrexsee/open/TencentOauth$OauthRunnable;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lrexsee/open/TencentOauth;

.field private final synthetic val$runnable:Lrexsee/open/TencentOauth$OauthRunnable;


# direct methods
.method constructor <init>(Lrexsee/open/TencentOauth;Lrexsee/open/TencentOauth$OauthRunnable;)V
    .locals 0

    .prologue
    .line 1
    iput-object p1, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    iput-object p2, p0, Lrexsee/open/TencentOauth$4;->val$runnable:Lrexsee/open/TencentOauth$OauthRunnable;

    .line 267
    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 10

    .prologue
    const/4 v8, 0x0

    const-string v6, "&"

    const-string v6, "oauth_token"

    const-string v6, "UTF-8"

    .line 270
    iget-object v6, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    # getter for: Lrexsee/open/TencentOauth;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v6}, Lrexsee/open/TencentOauth;->access$1(Lrexsee/open/TencentOauth;)Lrexsee/core/browser/Browser;

    move-result-object v6

    iget-object v6, v6, Lrexsee/core/browser/Browser;->progressDialog:Lrexsee/core/progress/RexseeProgressDialog;

    const-string v7, "\u6b63\u5728\u83b7\u53d6\u8bbf\u95ee\u5bc6\u94a5......"

    invoke-virtual {v6, v7}, Lrexsee/core/progress/RexseeProgressDialog;->show(Ljava/lang/String;)V

    .line 271
    iget-object v6, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    iput-boolean v8, v6, Lrexsee/open/TencentOauth;->status_access_token:Z

    .line 275
    :try_start_0
    iget-object v6, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    const-string v7, "https://open.t.qq.com/cgi-bin/access_token"

    const-string v8, "GET"

    # invokes: Lrexsee/open/TencentOauth;->getSignatureBase(Ljava/lang/String;Ljava/lang/String;)Lrexsee/open/TencentOauth$SignatureBase;
    invoke-static {v6, v7, v8}, Lrexsee/open/TencentOauth;->access$5(Lrexsee/open/TencentOauth;Ljava/lang/String;Ljava/lang/String;)Lrexsee/open/TencentOauth$SignatureBase;

    move-result-object v0

    .line 276
    .local v0, "bs":Lrexsee/open/TencentOauth$SignatureBase;
    const-string v6, "oauth_verifier"

    iget-object v7, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    # getter for: Lrexsee/open/TencentOauth;->oauth_verifier:Ljava/lang/String;
    invoke-static {v7}, Lrexsee/open/TencentOauth;->access$17(Lrexsee/open/TencentOauth;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v0, v6, v7}, Lrexsee/open/TencentOauth$SignatureBase;->add(Ljava/lang/String;Ljava/lang/String;)V

    .line 277
    const-string v6, "oauth_token"

    iget-object v7, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    # getter for: Lrexsee/open/TencentOauth;->oauth_token:Ljava/lang/String;
    invoke-static {v7}, Lrexsee/open/TencentOauth;->access$18(Lrexsee/open/TencentOauth;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v0, v6, v7}, Lrexsee/open/TencentOauth$SignatureBase;->add(Ljava/lang/String;Ljava/lang/String;)V

    .line 278
    iget-object v6, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    invoke-virtual {v0}, Lrexsee/open/TencentOauth$SignatureBase;->get()Ljava/lang/String;

    move-result-object v7

    new-instance v8, Ljava/lang/StringBuilder;

    iget-object v9, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    # getter for: Lrexsee/open/TencentOauth;->oauth_consumer_secret:Ljava/lang/String;
    invoke-static {v9}, Lrexsee/open/TencentOauth;->access$6(Lrexsee/open/TencentOauth;)Ljava/lang/String;

    move-result-object v9

    invoke-static {v9}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v9

    invoke-direct {v8, v9}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v9, "&"

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    iget-object v9, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    # getter for: Lrexsee/open/TencentOauth;->oauth_token_secret:Ljava/lang/String;
    invoke-static {v9}, Lrexsee/open/TencentOauth;->access$19(Lrexsee/open/TencentOauth;)Ljava/lang/String;

    move-result-object v9

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v8

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-static {v7, v8}, Lrexsee/core/utilities/Utilities;->getHmacSHA1Signature(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-static {v6, v7}, Lrexsee/open/TencentOauth;->access$7(Lrexsee/open/TencentOauth;Ljava/lang/String;)V

    .line 280
    new-instance v6, Ljava/lang/StringBuilder;

    const-string v7, "oauth_consumer_key="

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v7, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    # getter for: Lrexsee/open/TencentOauth;->oauth_consumer_key:Ljava/lang/String;
    invoke-static {v7}, Lrexsee/open/TencentOauth;->access$8(Lrexsee/open/TencentOauth;)Ljava/lang/String;

    move-result-object v7

    const-string v8, "UTF-8"

    invoke-static {v7, v8}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    .line 281
    const-string v7, "&oauth_token="

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    iget-object v7, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    # getter for: Lrexsee/open/TencentOauth;->oauth_token:Ljava/lang/String;
    invoke-static {v7}, Lrexsee/open/TencentOauth;->access$18(Lrexsee/open/TencentOauth;)Ljava/lang/String;

    move-result-object v7

    const-string v8, "UTF-8"

    invoke-static {v7, v8}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    .line 282
    const-string v7, "&oauth_signature_method="

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, "HMAC-SHA1"

    const-string v8, "UTF-8"

    invoke-static {v7, v8}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    .line 283
    const-string v7, "&oauth_timestamp="

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    iget-object v7, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    # getter for: Lrexsee/open/TencentOauth;->oauth_timestamp:Ljava/lang/String;
    invoke-static {v7}, Lrexsee/open/TencentOauth;->access$11(Lrexsee/open/TencentOauth;)Ljava/lang/String;

    move-result-object v7

    const-string v8, "UTF-8"

    invoke-static {v7, v8}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    .line 284
    const-string v7, "&oauth_nonce="

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    iget-object v7, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    # getter for: Lrexsee/open/TencentOauth;->oauth_nonce:Ljava/lang/String;
    invoke-static {v7}, Lrexsee/open/TencentOauth;->access$9(Lrexsee/open/TencentOauth;)Ljava/lang/String;

    move-result-object v7

    const-string v8, "UTF-8"

    invoke-static {v7, v8}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    .line 285
    const-string v7, "&oauth_version="

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    const-string v7, "1.0"

    const-string v8, "UTF-8"

    invoke-static {v7, v8}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    .line 286
    const-string v7, "&oauth_signature="

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    iget-object v7, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    # getter for: Lrexsee/open/TencentOauth;->oauth_signature:Ljava/lang/String;
    invoke-static {v7}, Lrexsee/open/TencentOauth;->access$10(Lrexsee/open/TencentOauth;)Ljava/lang/String;

    move-result-object v7

    const-string v8, "UTF-8"

    invoke-static {v7, v8}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    .line 287
    const-string v7, "&oauth_verifier="

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    iget-object v7, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    # getter for: Lrexsee/open/TencentOauth;->oauth_verifier:Ljava/lang/String;
    invoke-static {v7}, Lrexsee/open/TencentOauth;->access$17(Lrexsee/open/TencentOauth;)Ljava/lang/String;

    move-result-object v7

    const-string v8, "UTF-8"

    invoke-static {v7, v8}, Ljava/net/URLEncoder;->encode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v7

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    .line 280
    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    .line 288
    .local v3, "params":Ljava/lang/String;
    new-instance v6, Ljava/lang/StringBuilder;

    const-string v7, "https://open.t.qq.com/cgi-bin/access_token?"

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v6, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    .line 289
    .local v5, "url":Ljava/lang/String;
    new-instance v6, Lrexsee/core/transportation/SecureHttpClient;

    iget-object v7, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    # getter for: Lrexsee/open/TencentOauth;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v7}, Lrexsee/open/TencentOauth;->access$1(Lrexsee/open/TencentOauth;)Lrexsee/core/browser/Browser;

    move-result-object v7

    invoke-direct {v6, v7}, Lrexsee/core/transportation/SecureHttpClient;-><init>(Lrexsee/core/browser/Browser;)V

    invoke-virtual {v6, v5}, Lrexsee/core/transportation/SecureHttpClient;->get(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    .line 290
    .local v4, "result":Ljava/lang/String;
    const-string v6, "&"

    const-string v7, "="

    const/4 v8, 0x0

    invoke-static {v4, v6, v7, v8}, Lrexsee/core/utilities/Utilities;->string2map(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Z)Ljava/util/HashMap;

    move-result-object v2

    .line 291
    .local v2, "map":Ljava/util/HashMap;, "Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/String;>;"
    const-string v6, "oauth_token"

    invoke-virtual {v2, v6}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_1

    const-string v6, "oauth_token_secret"

    invoke-virtual {v2, v6}, Ljava/util/HashMap;->containsKey(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_1

    .line 292
    iget-object v7, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    const-string v6, "oauth_token"

    invoke-virtual {v2, v6}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Ljava/lang/String;

    invoke-static {v7, v6}, Lrexsee/open/TencentOauth;->access$12(Lrexsee/open/TencentOauth;Ljava/lang/String;)V

    .line 293
    iget-object v7, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    const-string v6, "oauth_token_secret"

    invoke-virtual {v2, v6}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Ljava/lang/String;

    invoke-static {v7, v6}, Lrexsee/open/TencentOauth;->access$13(Lrexsee/open/TencentOauth;Ljava/lang/String;)V

    .line 294
    iget-object v6, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    const/4 v7, 0x1

    iput-boolean v7, v6, Lrexsee/open/TencentOauth;->status_access_token:Z

    .line 295
    iget-object v6, p0, Lrexsee/open/TencentOauth$4;->val$runnable:Lrexsee/open/TencentOauth$OauthRunnable;

    if-eqz v6, :cond_0

    iget-object v6, p0, Lrexsee/open/TencentOauth$4;->val$runnable:Lrexsee/open/TencentOauth$OauthRunnable;

    const/4 v7, 0x1

    invoke-virtual {v6, v7, v4}, Lrexsee/open/TencentOauth$OauthRunnable;->run(ZLjava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 302
    .end local v0    # "bs":Lrexsee/open/TencentOauth$SignatureBase;
    .end local v2    # "map":Ljava/util/HashMap;, "Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/String;>;"
    .end local v3    # "params":Ljava/lang/String;
    .end local v4    # "result":Ljava/lang/String;
    .end local v5    # "url":Ljava/lang/String;
    :cond_0
    :goto_0
    iget-object v6, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    # getter for: Lrexsee/open/TencentOauth;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v6}, Lrexsee/open/TencentOauth;->access$1(Lrexsee/open/TencentOauth;)Lrexsee/core/browser/Browser;

    move-result-object v6

    iget-object v6, v6, Lrexsee/core/browser/Browser;->progressDialog:Lrexsee/core/progress/RexseeProgressDialog;

    invoke-virtual {v6}, Lrexsee/core/progress/RexseeProgressDialog;->hide()V

    .line 303
    return-void

    .line 297
    .restart local v0    # "bs":Lrexsee/open/TencentOauth$SignatureBase;
    .restart local v2    # "map":Ljava/util/HashMap;, "Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/String;>;"
    .restart local v3    # "params":Ljava/lang/String;
    .restart local v4    # "result":Ljava/lang/String;
    .restart local v5    # "url":Ljava/lang/String;
    :cond_1
    :try_start_1
    iget-object v6, p0, Lrexsee/open/TencentOauth$4;->val$runnable:Lrexsee/open/TencentOauth$OauthRunnable;

    if-eqz v6, :cond_0

    iget-object v6, p0, Lrexsee/open/TencentOauth$4;->val$runnable:Lrexsee/open/TencentOauth$OauthRunnable;

    const/4 v7, 0x0

    invoke-virtual {v6, v7, v4}, Lrexsee/open/TencentOauth$OauthRunnable;->run(ZLjava/lang/String;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_0

    .line 299
    .end local v0    # "bs":Lrexsee/open/TencentOauth$SignatureBase;
    .end local v2    # "map":Ljava/util/HashMap;, "Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/String;>;"
    .end local v3    # "params":Ljava/lang/String;
    .end local v4    # "result":Ljava/lang/String;
    .end local v5    # "url":Ljava/lang/String;
    :catch_0
    move-exception v6

    move-object v1, v6

    .line 300
    .local v1, "e":Ljava/lang/Exception;
    iget-object v6, p0, Lrexsee/open/TencentOauth$4;->this$0:Lrexsee/open/TencentOauth;

    # getter for: Lrexsee/open/TencentOauth;->mBrowser:Lrexsee/core/browser/Browser;
    invoke-static {v6}, Lrexsee/open/TencentOauth;->access$1(Lrexsee/open/TencentOauth;)Lrexsee/core/browser/Browser;

    move-result-object v6

    const-string v7, "Oauth.accessToken"

    invoke-virtual {v6, v7, v1}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method
